package com.liwujie.common.controller;

import com.liwujie.common.bean.ResultBean;
import com.liwujie.common.ex.ValidateException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
//异常增强处理器
@RestControllerAdvice
public class GlobalExceptionController extends BaseController {
    /**
     * 处理参数校验异常
     * @param e
     * @return
     */
    @ExceptionHandler(ValidateException.class)
    public ResultBean handlerValidationException(ValidateException e) {
        return fail("参数校验失败", e.getErrorMap());
    }
}